home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DrawCalendar.h
-
- Contains: Module for displaying the calendar (Gregorian).
-
- Written by: Martin Minow
-
- Copyright: © 1994-1997 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- You may incorporate this sample code into your applications without
- restriction, though the sample code has been provided "AS IS" and the
- responsibility for its operation is 100% yours. However, what you are
- not permitted to do is to redistribute the source as "DSC Sample Code"
- after having made changes. If you're going to re-distribute the source,
- we require that you make it clear in the source that the code was
- descended from Apple Sample Code, but that you've made changes.
-
- DrawCalendar displays the calendar (Gregorian) for the selected date. The
- algorithm has been simplified and consequently will only work for dates within
- the Macintosh epoch.
-
- Note that DrawCalendar is common to the Control Strip and Setup application.
- If you change it, you must rebuild both modules.
- */
-
- #ifndef __DRAWCALENDAR__
- #define __DRAWCALENDAR__
-
- #include "MacCalendarCommon.h"
-
- #include <Types.h>
-
- /*
- * These functions are defined in DrawCalendar.c. They are not specific to
- * the Status Bar module interface.
- */
-
- /*
- * DrawCalendar draws the current calendar in the current port in the specified
- * display area.
- */
- void DrawCalendar(
- SavedSettingsHandle settings, /* Current font etc */
- short year, /* 1904 .. */
- short month, /* January == 1 */
- const Rect *displayRect /* Where to draw the text */
- );
-
- /*
- * GetCalendarDisplaySize returns the size of the calendar if it is to be drawn
- * in the specified fontNumber and fontSize.
- */
- Point GetCalendarDisplaySize(
- SavedSettingsHandle settings /* Current font etc */
- );
-
- /*
- * GetCalendarMonthRect uses the fontNumber and fontSize to compute the size
- * size of the calendar as it will be drawn. Then the function creates an
- * actual display rectangle that is centered in the specified displayRect.
- */
- void GetCalendarMonthRect(
- SavedSettingsHandle settings, /* Current font etc */
- const Rect *displayRect, /* Where to draw the text */
- Rect *monthRect /* Returns drawing rect */
- );
-
- #endif /* __DRAWCALENDAR__ */
-